#include "findhome.h"
#include <string.h>

char *findhome (char **env)
{
	int i;
	char *key;
	char *val;
	char *home = 0;
	for (i = 0; env [i]; i ++)
	{
		key = strtok (env [i], "=");
		val = strtok (0, "");
		if (! strcmp (key, "HOME"))
		{
			home = val;
		}
	}
	return home;
}

